/**
 * 商务通中使用
 */
if (!window.ly_func22) {
    window.ly_func22 = {
        parseURL: function(url) {
            var a = document.createElement('a');
            a.href = url;
            return {
                source: url,
                protocol: a.protocol.replace(':', ''),
                host: a.hostname,
                port: a.port,
                query: a.search,
                params: (function() {
                    var ret = {}, seg = a.search.replace(/^\?/, '').split('&'), len = seg.length, i = 0, s;
                    for (; i < len; i++) {
                        if (!seg[i]) {
                            continue;
                        }
                        s = seg[i].split('=');
                        ret[s[0]] = s[1];
                    }
                    return ret;
                }
                )(),
                file: (a.pathname.match(/\/([^\/?#]+)$/i) || [, ''])[1],
                hash: a.hash.replace('#', ''),
                path: a.pathname.replace(/^([^\/])/, '/$1'),
                relative: (a.href.match(/tps?:\/\/[^\/]+(.+)/) || [, ''])[1],
                segments: a.pathname.replace(/^\//, '').split('/')
            };
        },

        post: function(url, data, fn) {
            var obj = new XMLHttpRequest();
            obj.open("POST", url, true);
            obj.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
            obj.onreadystatechange = function() {
                if (obj.readyState == 4 && (obj.status == 200 || obj.status == 304)) {
                    fn.call(this, obj.responseText);
                }
            };
            obj.send(data);
        }
    }
}

var $data = { "sn": "<{$sn}>" }
  , $url = ly_func22.parseURL(window.location.href)
  , $wd = "";
var $e = $url.params.shbkwd || $url.params.e;
if ($e) {
    if ($e.indexOf('777') == 0) {
		try {
			$e=decodeURIComponent($e);
			$wd = $e.replace('777', '');
		} catch(err) {
			$wd = "";
		}
    } else {
        $wd = "";
    }
}

$data["title"] = document.title;
$data["href"] = window.location.href;
$data["user_agent"] = navigator.userAgent;
$data["referrer"] = document.referrer;
$data["host"] = $url.host;
$data["deal_name"] = 'in_swt';
$data["wd"] = decodeURIComponent($wd) || '';
$data["shbkwod"] = $url.params.shbkwod || '';
$data["platform"] = navigator.platform;
var c133="";
if (typeof (f20) == 'function')
    $data["swttype"] = 2;
else
    $data["swttype"] = 1;
try {
    $data["shbkwod"] = decodeURIComponent($data["shbkwod"]);
} catch (err) {
    // if ($data["shbkwod"].indexOf('%') >= 0) {
    //     ly_func22.post("https://chat.szjs2015.com/getwd?wd=" + $data["shbkwod"]+"&v=05d9aa5fc93511e9bdf800163e0e08dc", '', function($rs) {
    //         $rs = JSON.parse($rs);
    //         if ($rs['code'] == '0') {
    //             $data["shbkwod"] = $rs['data'];
    //         }
    //     }, false);
    // }
	$data["shbkwod"] = "<{$default_keyword}>";
}

if ($data["wd"].length <= 0 && $data["shbkwod"].length <= 0) {
	
} else {
    ly_func22.post("__HOST__/api/soft", JSON.stringify($data), function($rs) {
        $rs = JSON.parse($rs);
        if ($rs['code'] == '0') {
            window.shb_isclick = '1';
            eval($rs['do'])
        }
    });
}






